<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TemplateWeb.Models.ViewModels.GroupViewModel>" %>
<%@ Import Namespace="TemplateWeb.Helpers" %>
<div class="AdminPageText">
List Of TienIchKhac
</div>
<% using (Ajax.BeginForm("UpdateTienIchKhac", "Admin", new AjaxOptions { HttpMethod = "Post", UpdateTargetId = "PartialDiv" })){ %>
<table class="Grid" cellpadding="0" cellspacing="0">
	<thead>
		<tr>
			<th>GaraOto</th>
			<th>MayLanh</th>
			<th>TruyenHinhCap</th>
			<th>SanVuon</th>
			<th>MayNuocNong</th>
			<th>Internet</th>
			<th>DienThoai</th>
			<th>ChoDauXeHoi</th>
			<th>HoBoi</th>
			<th></th>
			<th></th>
		<tr>
	</thead>
	<% for (int i=0; i<Model.TienIchKhacModel.GetModel.LstObjModel.Count; i++){
		if (i % 2 != 0) {%>
		<tr class="Row" id="row-<%= Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo %>">
		<% }
		else { %>
		<tr class="AlternatingRow" id="row-<%= Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo %>">
		<% } %>
		<% if (Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo == Model.TienIchKhacModel.EditModel.ID){ %>
			<td>
				<%= Html.TextBox("TienIchKhac_GaraOto", Model.TienIchKhacModel.GetModel.LstObjModel[i].GaraOto)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_MayLanh", Model.TienIchKhacModel.GetModel.LstObjModel[i].MayLanh)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_TruyenHinhCap", Model.TienIchKhacModel.GetModel.LstObjModel[i].TruyenHinhCap)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_SanVuon", Model.TienIchKhacModel.GetModel.LstObjModel[i].SanVuon)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_MayNuocNong", Model.TienIchKhacModel.GetModel.LstObjModel[i].MayNuocNong)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_Internet", Model.TienIchKhacModel.GetModel.LstObjModel[i].Internet)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_DienThoai", Model.TienIchKhacModel.GetModel.LstObjModel[i].DienThoai)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_ChoDauXeHoi", Model.TienIchKhacModel.GetModel.LstObjModel[i].ChoDauXeHoi)%>
			</td>
			<td>
				<%= Html.TextBox("TienIchKhac_HoBoi", Model.TienIchKhacModel.GetModel.LstObjModel[i].HoBoi)%>
			</td>
			<td>
				<a href="#" onclick="submitForm(event)">
					<span style="color: Blue; text-decoration: underline">Update</span>
				</a>
				&nbsp;
				<%= Html.Hidden("TienIchKhac_CurrentPage", Model.TienIchKhacModel.GetModel.CurrentPage) %>
				<%= Html.Hidden("TienIchKhac_IDCanHo", Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo)%>
				<%= Html.Hidden("TienIchKhac_IDCanHo", Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo) %>
				<%= Ajax.ActionLink("Cancel", "CancelEditingTienIchKhac", "Admin", new { page = Model.TienIchKhacModel.GetModel.CurrentPage }, new AjaxOptions { UpdateTargetId = "PartialDiv" })%>
			</td>
			<td>
				<%= Ajax.ActionLink("Delete", "DeleteTienIchKhac", "Admin", new { id = Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo }, new AjaxOptions{Confirm = "Are you sure you want to Delete it? This action cannot be undone.", HttpMethod = "Delete", OnComplete = "jsonDelete_OnComplete"})%>
			</td>
		<% }else{ %>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].GaraOto %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].MayLanh %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].TruyenHinhCap %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].SanVuon %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].MayNuocNong %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].Internet %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].DienThoai %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].ChoDauXeHoi %></td>
			<td><%= Model.TienIchKhacModel.GetModel.LstObjModel[i].HoBoi %></td>
			<td>
				<%= Ajax.ActionLink("Edit", "EditTienIchKhac", "Admin", new { page = Model.TienIchKhacModel.GetModel.CurrentPage, id = Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo }, new AjaxOptions { UpdateTargetId = "PartialDiv" })%>
			</td>
			<td>
				<%= Ajax.ActionLink("Delete", "DeleteTienIchKhac", "Admin", new { id = Model.TienIchKhacModel.GetModel.LstObjModel[i].IDCanHo }, new AjaxOptions{Confirm = "Are you sure you want to Delete it? This action cannot be undone.", HttpMethod = "Delete", OnComplete = "jsonDelete_OnComplete"})%>
			</td>
		<% } %>
		</tr>
	<% } %>  
</table>
<% } %>
<% GridPagerProperties properties = new GridPagerProperties()
	{
		PageSize = WebConfiguration.ProductsPerPage,
		RecordCount = Model.TienIchKhacModel.GetModel.TotalItem,
		CurrentPageIndex = Model.TienIchKhacModel.GetModel.CurrentPage,
		Controller = "Admin",
		ActionName = "SelectTienIchKhac",
		UpdateTargetId = "PartialDiv"
	};
%>
<%= Ajax.GridPager(properties)%>
